package utils;

import org.apache.log4j.*;
import java.util.*;

public class AppProperties {

	static Logger myLogger = Logger.getLogger( AppProperties.class.getName() );

	public static String getProperty(String filename, String parameter) {
		
		//myLogger = Logger.getLogger( AppProperties.class.getName() );
		
		//PropertyConfigurator.configure("log4j.properties");

		String value = null;
		//myLogger.debug("Error en getProperty: " + filename);

		try{
		
			Locale currentLocale = new Locale("", "");
			ResourceBundle bundle = ResourceBundle.getBundle(filename, currentLocale);
			value = bundle.getString(parameter);

		} catch(Exception e) {
			e.printStackTrace() ;
			myLogger.error("Error en getProperty: " + e + "(" + filename + "," + parameter + ")");
		}
		
		return (value == null) ? "" : value;
	}

}